package com.cyz.user.controller;

import com.cyz.user.userService.StudyResourceService;
import com.cyz.user.userService.StudyResourceTypeService;
import com.cyz.common.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "用户端学习资源类接口")
@RestController
@RequestMapping("/studyResource")
public class StudyResourceController {

    @Autowired
    private StudyResourceTypeService studyResourceTypeService;
    @Autowired
    private StudyResourceService studyResourceService;

    @ApiOperation(value = "查询学习资源")
    @GetMapping("/queryStudyResources")
    public R queryStudyResources(){
        return studyResourceService.queryStudyResources();
    }

    @ApiOperation(value = "查询学习资源及其分类")
    @GetMapping("/queryStudyResourcesAndTypes")
    public R queryStudyResourcesAndTypes(){
        return studyResourceService.queryStudyResourcesAndTypes();
    }

    @ApiOperation(value = "查询学习资源分类及其资源")
    @GetMapping("/queryStudyResourceTypesAndStudyResources")
    public R queryStudyResourceTypesAndStudyResources(){
        return studyResourceTypeService.queryStudyResourceTypesAndStudyResources();
    }

    @ApiOperation(value = "查询学习资源分类及其资源")
    @GetMapping("/queryStudyResourceTypes")
    public R queryStudyResourceTypes(){
        return studyResourceTypeService.queryStudyResourceTypes();
    }
}
